package com.gec.web;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/showAddUser.action")
public class ShowAddUser extends HttpServlet {
	private static final long serialVersionUID = 1L;
   
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		/**
		 * 1 设置输出类型和编码
		 * 2写一个表单form
		 * 3提交
		 */
		PrintWriter out = response.getWriter();
		out.println("<html>");
		out.println("<head>");
		out.println("<link rel='stylesheet' href='css/bootstrap.css'>");
		out.println("</head>");
		out.println("<body>");
		out.println("<form action='addUser.action' method='post'  class='form-horizontal'>");
		
		// 隐藏域
		out.println("<input type='hidden' name='id'><br/>");
		

		out.println("<div class='form-group'>");
		out.println("<label class='control-label col-md-3'>用户名</label>");
		out.println("<div class='col-md-3'>");
		out.println("<input type='text' name='name' class='form-control' />");
		out.println("</div>");
		out.println("</div>");

		out.println("<div class='form-group'>");
		out.println("<label class='control-label col-md-3'>密码</label>");
		out.println("<div class='col-md-3'>");
		out.println("<input type='text' name='password' class='form-control' />");
		out.println("</div>");
		out.println("</div>");
		

		out.println("<div class='form-group'>");
		out.println("<label class='control-label col-md-3'>性别</label>");
		out.println("<div class='col-md-3'>");
		out.println("<div class='radio'>");
		out.println("<label>");
		out.println("<input type='radio' name='sex' value='男' checked>男");
		out.println("</label>");
		out.println("<label>");
		out.println("<input type='radio'  name='sex' value='女'>女");
		out.println("</label>");
		out.println("</div>");
		out.println("</div>");
		out.println("</div>");


		
		out.println("<div class='form-group'>");
		out.println("<div class='col-md-3'></div>");
		out.println("<div class='col-md-3'><button class='btn btn-success'>注册</button></div>");
		out.println("</div>");
		out.println("</form>");
		out.println("</body>");
		out.println("</html>");
	}

}
